package com.home.truc.code.process;

import java.awt.Component;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.JOptionPane;
import javax.swing.JWindow;

public class MyTimerHideComponent {
	Timer timer;
	JWindow frm;
	boolean canhide = true;

	  public MyTimerHideComponent(int seconds, JWindow f) {
		  this.frm = f;
		  timer = new Timer();
		  timer.scheduleAtFixedRate(new TimerTask() {
			  public void run() {
				  if(CanHide())
					  frm.hide();
			  }
		  }, seconds*1000, seconds*1000);	  
	  }	
	  public boolean CanHide()
	  {
		  return this.canhide;
	  }
	  public void SetCanHide(boolean b)
	  {
		  this.canhide = b;
	  }
}
